<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditDepartmentEntityTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages globalOnly="true" errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="3">
                    <h:outputLabel value="DepartmentName" for="name" />
                    <h:inputText id="name" value="#{departmentEntityController.selected.name}" title="#{bundle.EditDepartmentEntityTitle_name}" required="true" requiredMessage="Please enter a department name" validator ="#{contactEntityController.validateEmail}"/>
                    <h:message styleClass="errorMsg" for= "name" errorStyle="color: red"/> 
                
                <h:outputLabel value="#{bundle.CreateDepartmentEntityLabel_manager}" for="manager" />
                <h:selectOneMenu id="manager" value="#{departmentEntityController.selected.manager}" title="#{bundle.CreateDepartmentEntityTitle_manager}" >
                    <f:selectItems value="#{systemUserEntityController.itemsAvailableSelectOne}"/>
                <f:validator validatorId="macTeam.SystemUserSelectOneMenuValidator" />
                </h:selectOneMenu>
                <h:message styleClass="errorMsg" for="manager" errorStyle="color: red"/>
                
                </h:panelGrid>
                <h:commandLink action="#{departmentEntityController.update}" value="#{bundle.EditDepartmentEntitySaveLink}"/>
                <br />
                <br />
                <h:commandLink action="View" value="#{bundle.EditDepartmentEntityViewLink}" immediate="true"/>
                <br />
                <h:commandLink action="#{departmentEntityController.prepareList}" value="#{bundle.EditDepartmentEntityShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.EditDepartmentEntityIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
